#!/usr/bin/env python
# -*- coding:utf-8 -*-

# file:do_exam5.py
# author:肖宇轩
# datetime:2024-11-12 19:31
# software: VsCode
"""
5 定义一个列表，通过键盘输入10个同学的姓名，以及其Python成绩保存到该列表；计算出平均分、最高分，最低分并打印；
"""

students = []

for i in range(10):
    name = input(f"请输入第{i + 1}个同学的姓名: ")
    score = float(input(f"请输入{name}的Python成绩: "))
    students.append((name, score))

scores = [score for _, score in students]  
average_score = sum(scores) / len(scores)   
highest_score = max(scores)                 
lowest_score = min(scores)                  

print("\n学生成绩列表:")
for student in students:
    print(f"{student[0]}: {student[1]} 分")

print(f"\n平均分: {average_score:.2f}")
print(f"最高分: {highest_score}")
print(f"最低分: {lowest_score}")
